package com.campusnews.controller;


import com.campusnews.annotation.LoginToken;
import com.campusnews.pojo.SecondComment;
import com.campusnews.service.SecondCommentService;
import com.campusnews.utils.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lqc
 * @since 2021-09-26
 */
@RestController
@RequestMapping("/secondComment")
@Api(tags={"二级评论API"})
public class SecondCommentController {
    @Autowired
    private SecondCommentService secondCommentService;

//    @LoginToken
//    @ApiOperation(value = "修改二级评论信息", notes = "修改二级评论信息")
//    @RequestMapping(value = "/updateSecondComment" ,method = RequestMethod.POST)
//    public JsonResult updateSecondComment(@RequestBody SecondComment secondComment) {
//        return secondCommentService.updateSecondComment(secondComment);
//    }
//
//    @LoginToken
//    @ApiOperation(value = "添加二级评论信息", notes = "添加二级评论信息")
//    @RequestMapping(value = "/insertSecondComment" ,method = RequestMethod.POST)
//    public JsonResult insertSecondComment(@RequestBody SecondComment secondComment) {
//        return secondCommentService.insertSecondComment(secondComment);
//    }

    @LoginToken
    @ApiOperation(value = "删除二级评论信息", notes = "删除二级评论信息")
    @RequestMapping(value = "/deleteSecondComment" ,method = RequestMethod.POST)
    public JsonResult deleteSecondComment(@RequestBody SecondComment secondComment) {
        return secondCommentService.deleteSecondComment(secondComment);
    }
}

